<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/5/18
  Time: 5:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="lib/jquery-1.8.3.min.js"></script>
</head>
<body>
    <h3>重定向</h3>

    <button id="btn1">发送ajax</button>
<script>
    $(function () {
        $("#btn1").click(function () {
            alert("123");
            $.ajax({
                url:'user/testAjax',
                contentType:"application/json;charset=UTF-8",
                type:'post',
                dataType:'json',
                data:'{"username":"hehe","password":"123","age":30}',
                success:function (data) {
                    console.log(data);
                }
            })
        })
    })
</script>
</body>
</html>
